<template>
  <div class="rank-list">
    <div class="title">
      <slot name="font">
        <p>推荐榜</p>
      </slot>
    </div>
    <div class="list">
      <rank-list-item v-for="(item,index) in listItem"
                      :key="index" v-bind:list="item"
                      @click.native="listClick(index)"
      ></rank-list-item>
    </div>
  </div>
</template>

<script>
  import RankListItem from "./RankListItem";
    export default {
        name: "RankList",
        components:{
            RankListItem,
        },
        props:{
            listItem:{
                type:Array,
                default(){
                    return[]
                }
            },
        },
        data(){
            return{

            }
        },
        methods:{
            listClick(index){
                // console.log(this.listItem[index].id)
                this.$router.push('/songlist/'+ this.listItem[index].id)
            }
        },
        created() {
            // console.log(this.listItem)
        }
    }
</script>

<style scoped>
  .rank-list{
    position: relative;
    /*top: 460px;*/
    margin-left: 10px;
    font-size: 12px;
    overflow: hidden;
  }

  .title{
    font-size: 14px;
    font-weight: bold;
    margin-top: 20px;
    font-size: 18px;
    color: black;
  }


  .list{
    margin: 0px;
    padding: 0px;
  }




</style>